def frac(s1, s2):
    if s1[0] == '$':
        s1 = s1[1:]
        s3 = "$\\frac{" + s1 + "}{" + s2 + "}"
    else:
        s3 = "\\frac{" + s1 + "}{" + s2 + "}"
    return s3


def replace(s1, s2):
    if s1[0] == '$':
        s1 = s1[1:]
        s3 = "$\\" + s2 + "{" + s1 + "}"
    else:
        s3 = "\\" + s2 + "{" + s1 + "}"
    return s3
